package com.wzdigit.wms.basic.mapper.core.transfer;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wzdigit.framework.orm.mybatis.MyBatisRepository;
import com.wzdigit.wms.basic.domain.transfer.GdnDtlGoods;
import com.wzdigit.wms.basic.client.request.transfer.GdnDtlGoodsSimpleReq;
import com.wzdigit.wms.basic.client.response.transfer.GdnDtlGoodsListResponse;
import com.wzdigit.wms.basic.client.response.transfer.GdnDtlGoodsReportResponse;
import com.wzdigit.wms.basic.enums.GdnDtlGoodsStatusEnum;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 发货单明细货品清单 Mapper 接口
 * </p>
 *
 * @author 
 * @since 2021-02-22
 */
@MyBatisRepository
public interface GdnDtlGoodsMapper extends BaseMapper<GdnDtlGoods> {

	List<GdnDtlGoodsReportResponse> selectGdnDtlGoodsReportList(
			@Param("gdnHeaderId") Long gdnHeaderId, @Param("noteType") String noteType);
	
	List<GdnDtlGoodsListResponse> selectAll(Integer gdnDtlId);
	
	List<String> selectBySourceNo(@Param("sourceNo") String sourceNo);

    /**
     * 根据SN查询来源发货通知单
     * @param sn
     * @return
     */
//    String selectSourceBySn(@Param("sn") String sn);
    List<String> selectSourceBySn(@Param("sn") String sn);

    List<String> selectSnListByDtlIds(@Param("dtlList") List<Integer> dtlList);

    GdnDtlGoodsSimpleReq selectGdnNoBySn(String goodsSN);

    String selectSourceBySnAndDtlId(@Param("sn") String sn, @Param("dtlId") Long dtlId);

    String selectSourceByDtlId(@Param("dtlId") Long dtlId);
    /*查询明细列表条码列表（原材料）
        * @param gdnDtlId
        * @return java.util.List<com.wzdigit.wms.basic.client.response.transfer.GdnDtlGoodsListResponse>
        * @author shuaic
        * @date 2021/7/14 14:37
    */
    List<GdnDtlGoodsListResponse> selectAllRaw(Integer gdnDtlId);
    
    int selectCountSnGdn(@Param("gdnHeaderId")Long gdnHeaderId);

    List<String> selectByHeaderIdAndDtlGoodsStatus(@Param("headerId") Long gdnHeaderId,@Param("status") int status);

}
